
public class Album extends Item{
	private static final long serialVersionUID = 1L;
	Track[] tracks; 	//Tracks in this album
	int tlen;			//Number of tracks in this album
	Artist artist;		//The artist of this album
	
	Album(){
		//Default constructor
		tracks = new Track[32];
	}
	
	Album(Item item){
		//Copy constructor the make Album out of items
		super(item);
		tracks = new Track[32];
	}
	
	Track[] getTracks(){
		return tracks;
	}
	
	int getTlen(){
		return tlen;
	}
	
	Artist getArtist(){
		return artist;
	}
	
	
	
	void putTrack(Track track) {
		//Add an item to the the itemsBy array
		if (tlen > tracks.length - 1) {
			growTracks();
		}
		tracks[tlen] = track;
		tlen++;
	}

	void shrinkTracks() {
		//Shrink the itemsBy array to a minimal size
		Track[] temp = new Track[tlen];
		System.arraycopy(tracks, 0, temp, 0, tlen);
		tracks = temp;
		temp = null;

	}

	private void growTracks() {
		Track[] temp = new Track[tlen * 2];
		System.arraycopy(tracks, 0, temp, 0, tlen);
		tracks = temp;
		temp = null;
	}
}
